﻿@model MPosters.Models.Poster

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

 @using (Html.BeginForm("Create","PosterManager",System.Web.Mvc.FormMethod.Post, new { @encType = "multipart/form-data" }))
 {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Poster</legend>
                <div class="editor-label">
            @Html.LabelFor(model => model.BoardId, "Board")
        </div>
        <div class="editor-field">
            @Html.DropDownList("BoardId", String.Empty)
            @Html.ValidationMessageFor(model => model.BoardId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Content)
        </div>
        <div class="editor-field">
            
            @Html.TextAreaFor(model => model.Content, new { @class="ckeditor", @id="text-details"})
            @Html.ValidationMessageFor(model => model.Content)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.PosterImgUrl)
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.PosterImgUrl)
            @Html.ValidationMessageFor(model => model.PosterImgUrl)
        </div>

            @FileUpload.GetHtml(initialNumberOfFiles:1, allowMoreFilesToBeAdded: true, includeFormTag: false, addText: "Add Files", uploadText: "Upload File")
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div class="left">
    @Html.ActionLink("Back to List", "Index")
</div>
